﻿@using NavKet.Models;
@model NavKet.Models.Department
@{
    ViewBag.Title = "EditDepartment";
    Layout = "~/Views/Admin/AdminMasterPage.cshtml";
}
<div id="content">
    <form method="post"  action="/ShopAdmin/EditDepartment/@Model.id?shopId=@Model.ShopId" >
    <table border="0" cellpadding="0" cellspacing="0" id="id-form">
        <tr>
            <th valign="top">
                department name:
            </th>
            <td>
                <input type="text" name="txtDeptName" class="inp-form" value="@Model.name" />
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <th valign="top">
                department Descreption:
            </th>
            <td>
                <input type="text" name="txtDeptDecreption" class="inp-form" value="@Model.Description" />
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <th valign="top">
                Category:
            </th>
            <td>
                <select name="catid">
                    @foreach (Category item in ViewBag.MallCategories)
                    {
                        if (Model.categoryId == item.id)
                        {
                        <option selected="selected" value="@item.id">@item.name</option>     
                        }
                        else
                        {
                        <option value="@item.id">@item.name</option>     
                        }
                    }
                </select>
            </td>
        </tr>
    </table>
    <input type="submit" class="form-submit" value="">
    <!--  startDepartment Items-table ..................................................................................... -->
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
        <tr>
            <th class="table-header-repeat line-left minwidth-1">
                <a href="">Name</a>
            </th>
            <th class="table-header-repeat line-left minwidth-1">
                <a href="">Price</a>
            </th>
            <th class="table-header-repeat line-left minwidth-1">
                <a href="">Quantity</a>
            </th>
            <th class="table-header-repeat line-left minwidth-1">
                <a href="">MainImage</a>
            </th>
            <th class="table-header-repeat line-left minwidth-1">
                <a href="">Model</a>
            </th>
            <th class="table-header-repeat line-left minwidth-1">
                <a href="">Released year </a>
            </th>
            <th class="table-header-options line-left">
                <a href="">Options</a>
            </th>
        </tr>
        @foreach (Item item in ViewBag.DepartmentItems)
        {
            <tr>
                <td>
                    <h1>
                        @item.name
                    </h1>
                </td>
                <td>
                    <h1>
                        @item.price</h1>
                </td>
                <td>
                    <h1>
                        @item.quantity
                    </h1>
                </td>
                <td>
                    <img width="50px" height="50px" src="/Content/pics/@item.MainImage" />
                </td>
                <td>
                    <h1>
                        @item.model
                    </h1>
                </td>
                <td>
                    <h1>
                        @item.RelesedYear
                    </h1>
                </td>
                <td class="options-width">
                    <a href="/ShopAdmin/AddItem?shopId=@item.Department.ShopId&deptId=@item.DepartmentId" title="Add" class="icon-1 info-tooltip">
                    <a href="/ShopAdmin/EditItem/@item.id?shopId=@item.Department.ShopId" title="Edit" class="icon-1 info-tooltip">
                        <a href="/ShopAdmin/DeleteItem/@item.id?deptId=@item.DepartmentId" title="Delete" class="icon-2 info-tooltip">
                        </a>
                </td>
            </tr>
        }
    </table>
    <!--  end Department Items-table................................... -->
    </form>
</div>
<!--  end content -->
